<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>${setting.siteName} - 编辑医生坐班表</title>
    <meta name="keywords" content="${setting.siteName}">
  	<meta name="description" content="${setting.siteName}">
  	<!-- BEGIN HEADER -->
		[#include "/admin/include/style.ftl"]
	<!-- END HEADER -->
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                    	 <h5>编辑医生坐班表</h5>
                    	 <div class="ibox-tools">
                    	 	<button type="button" class="btn btn-outline btn-white btn-xs" id="btn-return-loippi" 
                    	 	onclick="location.href='${base}/admin/doctor_work/list.jhtml'"><i class="fa fa-reply-all"></i> 返回列表</button>
                        </div>
                    </div>            	
                  	<div class="ibox-content">
                  		<form id="inputForm" class="form-horizontal" action="${base}/admin/doctor_work/update.jhtml" method="post">
                  		<input type="hidden" value="${doctorWork.id}" name="id"/>
                       
                           <div class="form-group">
                       		<div class="row">
                       			<div class="col-sm-6">
                       			 	<label class="col-sm-3 control-label">医生姓名</label>
	                                <div class="col-sm-9">
		                                <select id="doctorId" class="form-control" name="doctorId" maxlength="200" required="required">
																			<option>请选择</option>
                                        [#list doctors as ds]
					                                <option value="${ds.id}">${ds.name}</option>
                                        [/#list]
																		</select>
	                                </div>
                       			</div>
		                        <div class="col-sm-6">
                       			 	<label class="col-sm-3 control-label">值班日期</label>
	                                <div class="col-sm-9">
		                                <input type="text" id="work_date" name="workDate" class="form-control" placeholder="请选择日期" required="required" value="${doctorWork.workDate?string('yyyy-MM-dd')}">
		                                </input>
	                                </div>
                       			</div>
													</div>
                        </div>
							<!--/row-->

                           <div class="form-group">
                       		<div class="row">
                       			<div class="col-sm-6">
                       			 	<label class="col-sm-3 control-label">值班时间段</label>
	                                <div class="col-sm-9">
		                                <select id="work_time" class="form-control" name="workTime" maxlength="200" required="required">
																			<option>请选择</option>
			                                <option value="0">上午</option>
			                                <option value="1">下午</option>
		                                </select>
	                                </div>
                       			</div>
                       			<div class="col-sm-6">
                       			 	<label class="col-sm-3 control-label">放号</label>
	                                <div class="col-sm-9">
	                                    <input type="text" name="surplus" class="form-control" maxlength="200" value="${(doctorWork.surplus)!''}"/>
	                                </div>
                       			</div>
													</div>
                        </div>
							<!--/row-->
							
                           <div class="form-group">
                       		<div class="row">
                       			<div class="col-sm-6">
                       			 	<label class="col-sm-3 control-label">时间间隔</label>
	                                <div class="col-sm-9">
	                                    <input type="text" name="gap" class="form-control" maxlength="200" value="${(doctorWork.gap)!''}"/>
	                                </div>
                       			</div>
													</div>
                        </div>
							<!--/row-->
							
                       		
                       
                         <div class="hr-line-dashed"></div>
	                    <div class="form-group">
	                        <div class="col-sm-12 col-sm-offset-10">
	                        	<button type="button" class="btn btn-default" onclick="window.history.back();">返回</button>
	                            <button class="btn btn-success" type="submit">保存内容</button>
	                        </div>
	                    </div>
	                    </form>
                  	</div>
                </div>
            </div>
        </div>
    </div>
	<!-- BEGIN Script -->
		[#include "/admin/include/script.ftl"]
    <script src="${base}/resources/js/plugins/layer/laydate/laydate.js"></script>
    <!-- END Script -->
    <script>
        $(document).ready(function () {
        	[@flash_message /]
        	$(".chosen-select").chosen({width:"100%"}); 
        	$(".input-daterange").datepicker({keyboardNavigation:false,forceParse:false,autoclose:true});
        	
        	$(".browserButton").browser({callback:function(url){
				$("#"+$(this).attr('for')).val(url);
			}});
        	
    		$(".input-group.date").datepicker({todayBtn:"linked",keyboardNavigation:false,forceParse:false,calendarWeeks:true,autoclose:true});
          $("#inputForm").validate({
            rules: {
              doctorId: {
                required: true
              },
              workDate: {
                required: true
              },
              workTime: {
                required: true
              },
              gap: {
                required: true
              }
            },
            messages: {
            }
          });
        });
        $("#work_time option[value=" + ${doctorWork.workTime} + "]").attr("selected", "selected");
        $("#doctorId option[value=" + ${doctorWork.doctorId} + "]").attr("selected", "selected");

        // layui.use('laydate', function(){
        //   var laydate = layui.laydate;

          //执行一个laydate实例
          laydate.render({
            elem: '#work_date' //指定元素
          });
        // });
    </script>
</body>
</html>
